package com.thp.comparable;

public class Strudent implements Comparable<Strudent>{
	private int id;
	private int age;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public Strudent() {}
	public Strudent(int id, int age) {
		this.id = id;
		this.age = age;
	}
	@Override
	public String toString() {
		return "Strudent [id=" + id + ", age=" + age + "]";
	}
	@Override
	public int compareTo(Strudent o) {
		return -(this.id - o.id);
	}
	
	
	
}
